package com.msmall.community.bbs.service;

import java.util.List;

import com.msmall.base.exception.DataNotFoundException;
import com.msmall.base.pager.PaginationSupport;
import com.msmall.base.service.BaseManager;
import com.msmall.community.bbs.model.Master;


public interface MasterManager extends BaseManager<Master, Long>{

	/**
	 * 通过版区查找此版区的版主
	 * @param boardId
	 * @return
	 * @throws DataNotFoundException
	 */
	public List<Master> getMastersByBoardId(Long boardId) throws DataNotFoundException;
	
	public Master getMaster(Long boardId, Long userid) throws DataNotFoundException;
	/**
	 * 通过回复贴查找此回复贴的版区的版主信息
	 * @param threadId
	 * @return
	 * @throws DataNotFoundException
	 */
	public List<Master> findMasterByThreadId(Long threadId) throws DataNotFoundException;
	
	public List<Master> findMasterByUserid(Long userid) throws DataNotFoundException;
	
	/**
	 * 通过主题贴查找此主题贴的版区的版主信息
	 * @param topicId
	 * @return
	 * @throws DataNotFoundException
	 */
	public List<Master> findMasterByTopicId(Long topicId) throws DataNotFoundException;
	
	/**
	 * 删除管理员
	 * @param masterIds
	 */
	public void delete(String masterIds);
	
	/**
	 * 递归解除此版区和子版区管理权限
	 */
	public void iteratorMasterReduce(Long boardId, Long userid, int level) throws DataNotFoundException;
	
	/**
	 * 当创建或者更新版区时，修改此版区的版主信息
	 * @param board
	 */
	public void saveBoardMaster(Long boardId);
	/**
	 * 搜索用户， 为设置版主提供用户
	 * @param page
	 * @param searchType
	 * @param searchValue
	 */
	public void search(PaginationSupport page, String searchType, String searchValue); 
	
	/**
	 * 设置版主
	 * @param boardId
	 * @param level
	 */
	public void setMaster(Long boardId, Long userid, String level);
	
	/**
	 * 移动帖子
	 * @param boardId
	 * @param toBoardId
	 * @param topicId
	 */
	public void move(Long boardId, Long toBoardId, Long topicId);
}
